package com.example.demo.guanchazhe;

public class CurrentConditions implements Observer{

    //温度 气压 湿度
    private float temperature;
    private float pressure;
    private float humidity;

    //更新天气情况 由weatherData 来调用 我们使用推送模式
    @Override
    public void update(float temperature, float pressure, float humidity){
        this.humidity=humidity;
        this.pressure=pressure;
        this.temperature=temperature;
        display();
    }

    //显示
    public void display(){
        System.out.println("今天温度："+temperature);
        System.out.println("今天湿度："+humidity);
        System.out.println("今天气压："+pressure);
    }
}
